﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Forest.Cat.Domain.Shared.Validation
{
    public static class ValueTypeCheck
    {
        public static bool CheckDateTime(string year, string month, string day)
        {
            var strData = year + "-" + month + "-" + day;
            return CheckDateTime(strData);
        }

        public static bool CheckDateTime(string strData)
        {
            DateTime min = new DateTime(1900, 1, 1);
            DateTime max = new DateTime(3000, 1, 1);
            DateTime dt = DateTime.Now;
            bool check = DateTime.TryParse(strData, out dt);
            if (check)
            {
                return dt >= min && dt <= max;
            }
            return false;
        }
    }
}
